package com.utils.toast

import android.view.Gravity
import android.widget.Toast

/**
 * @describe:
 * @Author: lixiaopeng
 * @Date: 4/7/21
 */
abstract class BaseToast : IToast {

    @IToast.Duration
    protected var toastDuration = Toast.LENGTH_SHORT

    protected var gravity = Gravity.CENTER
    protected var xOffset = 0
    protected var yOffset = 0

    protected var toastView: IToastView? = null

    override fun setGravity(gravity: Int, xOffset: Int, yOffset: Int) {
        this.gravity = gravity
        this.xOffset = xOffset
        this.yOffset = yOffset
    }

    override fun setDuration(@IToast.Duration duration: Int) {
        this.toastDuration = duration
    }

    override fun setView(toastView: IToastView?) {
        this.toastView = toastView
    }
}
